//
//  ViewController.m
//  Collisions
//
//  Created by iD Student on 7/9/13.
//  Copyright (c) 2013 iD Student. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	boringLabel.text=[NSString stringWithFormat:@""];
    imageView1.image=[UIImage imageNamed:@"untitled-1.png"];
    imageView2.image=[UIImage imageNamed:@"untitled-2.png"];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    UITouch *touch = [touches anyObject];
    CGPoint touchPoint = [touch locationInView:[self view]];
    if (CGRectContainsPoint(imageView1.frame, touchPoint))
    {
        boringLabel.text = @"You are touching blue!";
    }
    else if (CGRectContainsPoint(imageView2.frame, touchPoint))
    {
        boringLabel.text = @"You are touching orange!";
    }
    else{
        boringLabel.text = @"";
    }
}

-(void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
    UITouch *touch = [touches anyObject];
    CGPoint touchPoint = [touch locationInView:[self view]];
    if (CGRectContainsPoint(imageView1.frame, touchPoint))
    {
        boringLabel.text = @"";
    }
    else if (CGRectContainsPoint(imageView2.frame, touchPoint))
    {
        boringLabel.text = @"";
    }
    else{
        boringLabel.text = @"";
    }
}
@end
